'''
Created on 10.09.2012

@author: doleynik
'''

from google.appengine.ext import db

class APNETUser(db.Model):

    first_name = db.StringProperty(required=True, verbose_name = 'First name')
    last_name = db.StringProperty(required=True, verbose_name = 'Last name')
    primary_phone = db.PhoneNumberProperty(required=True, verbose_name = 'Phone number')
    primary_email = db.EmailProperty(verbose_name = 'Google account primary email')
    state = db.BooleanProperty(default=True)
    created = db.DateTimeProperty(auto_now_add=True)
    is_syndic_creator = db.BooleanProperty(default=False, verbose_name = "Create syndic's?")
    is_syndic_admin = db.BooleanProperty(default=False, verbose_name = "Syndic manager?")
    is_immeuble_admin = db.BooleanProperty(default=False, verbose_name = "Immeuble manager?")
    is_lot_owner = db.BooleanProperty(default=False, verbose_name = "Lot owner?")
    lang = db.StringProperty(default="fr", choices=("fr", "en"), verbose_name = "Interface language")
    last_active_immeuble_id = db.IntegerProperty(required=False)
    
    def __repr__(self):
        return unicode("%s %s" % (self.last_name, self.first_name))
